#pragma once
#include <string>
#include <vector>
#include <map>

namespace ilp {

struct ILPPoint {
    std::string measurement;
    std::map<std::string, std::string> tags;
    std::map<std::string, double> fields;
    int64_t timestamp_ns;
};

/**
 * Parse InfluxDB Line Protocol format
 * Format: measurement[,tag_key=tag_value[,...]] field_key=field_value[,...] [timestamp]
 * Example: cpu,host=server01,region=us-west usage=0.64,temp=72.0 1465839830100400200
 */
bool parse_ilp_line(const std::string& line, ILPPoint* point);
bool parse_ilp_batch(const std::string& data, std::vector<ILPPoint>* points);

} // namespace ilp